import Dexie, { EntityTable } from 'dexie';

export const db = new Dexie('script_box_database') as Dexie & {
  projects: EntityTable<ProjectItem, 'id'>;
  resources: EntityTable<ScriptResourceInfo, 'id'>;
};

// Schema declaration:
db.version(1).stores({
  projects: 'id, name, author',
  resources: '++id,key',
});